def watch(filename):
    try:
        with open(filename, encoding='utf-8') as f_obj:
            contents = f_obj.read()
            print(contents)
    except FileNotFoundError:
        print("文件不存在！")

filenames = ['cat.txt','dog.txt']
for filename in filenames:
    watch(filename)

